
public class P7 {
	public static boolean isPrime(long x) {
		long max = (long) Math.floor(Math.sqrt(x));
		for (long i = 2; i <= max; i++) {
			if (x%i == 0) {
				return false;
			}
		}
		
		return true;
	}
	
	public static void main(String[] args) {
		int x = 2;
		int count = 0;
		
		while (true) {
			if (isPrime(x)) {
				count++;
			}
			
			if (count == 10001) {
				System.out.println(x);
				return;
			}
			
			x++;
		}
	}
}
